package com.yhb.channel.impl.ANYPAY;

import com.yhb.channel.exception.PayChannelException;
import com.yhb.channel.impl.ANYPAY.http.response.AnyPayBaseRespModel;
import lombok.*;

@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class AnyPayException extends PayChannelException {
    /**
     * code域划分
     * 第1位 通道号
     * 第2-3位 错误类型
     * 第4-8位 通道错误码
     */

    AnyPayBaseRespModel rsp;

    public AnyPayException(Long code, String message) {
        super(code, message);
        this.channelType = AnyPayChannel.CHANNEL_TYPE;
        this.channelName = AnyPayChannel.CHANNEL_NAME;
    }

    public AnyPayException(Long code, String message, Throwable nestedException) {
        super(code, message, nestedException);
        this.channelType = AnyPayChannel.CHANNEL_TYPE;
        this.channelName = AnyPayChannel.CHANNEL_NAME;
    }

    public AnyPayException(String code, String message, Throwable nestedException) {
        super(code, message, nestedException);
        this.channelType = AnyPayChannel.CHANNEL_TYPE;
        this.channelName = AnyPayChannel.CHANNEL_NAME;
    }
}
